#!/bin/sh

while :
do
        dm_worker_num=`ps aux > temp && grep "dm-worker.test" temp | wc -l && rm temp`
        echo "$dm_worker_num dm-worker alive"
        if [ $dm_worker_num -ne 0 ]; then
                killall dm-worker.test || true
                sleep 1
        else
                break
        fi
done